package observerPattern.old;

import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * @author： pang-yun
 * @date： 2021-10-25 17:21
 * 功能目的 ：用于
 */
@Data
@AllArgsConstructor
public class WeatherData {
    // 最新的 天气信息
    private float temperature;
    private float pressure;
    private float humidity;

    // 前台展示的信息
    private CurrentConditions conditions;


    // 当前数据有更新时
    public void setData(float temperature, float pressure, float humidity){
        this.temperature = temperature;
        this.pressure = pressure;
        this.humidity = humidity;
        conditions.update(temperature,pressure,humidity);
    }


}
